package org.br.plotter.gui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class CustomMessage extends JDialog {

	public CustomMessage(JPanel panel) {
		JPanel contentPane = new JPanel();
		contentPane.setLayout(new BorderLayout());
		contentPane.add(panel, BorderLayout.CENTER);
		setContentPane(contentPane);
		JPanel buttonPanel = new JPanel();
		contentPane.add(buttonPanel, BorderLayout.SOUTH);
		JButton okay = new JButton("OK");
		buttonPanel.add(okay);
		okay.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				dispose();

			}
		});
		setBounds(200, 150, 280, 200);
		setResizable(false);

		setModal(true);
		show();

	}

	public static void main(String[] args) {
		JPanel p = new JPanel();
		p.add(new JLabel("Toto"));
		CustomMessage c = new CustomMessage(p);
		c.setVisible(true);
	}
}
